package com.uicole.push.server.model;

import java.util.Calendar;
import java.util.Date;

public class PushMsg {
	private long id;
    private String pushId;
    private String appId;
    private String msg;
    private int type;//0 群体消息 1 ，多设备 2 多别名
    private String toUser;//发送对象，多个用“，”隔开
    private Date outTime;//最后发送时间
    private Date createTime;//发送时间
    private int status;//发送状态  0 等待发送 1 发送中 2 已发送 3 发送失败  
	public long getId() {
		return id;
	}
	public void setId(long id) {
		this.id = id;
	}
	public String getPushId() {
		return pushId;
	}
	public void setPushId(String pushId) {
		this.pushId = pushId;
	}
	public String getAppId() {
		return appId;
	}
	public void setAppId(String appId) {
		this.appId = appId;
	}
	public String getMsg() {
		return msg;
	}
	public void setMsg(String msg) {
		this.msg = msg;
	}
	public int getType() {
		return type;
	}
	public void setType(int type) {
		this.type = type;
	}
	public String getToUser() {
		return toUser;
	}
	public void setToUser(String toUser) {
		this.toUser = toUser;
	}
	public Date getOutTime() {
		return outTime==null?addTreeDay(createTime,3):outTime;
	}
	private Date addTreeDay(Date date,int day){
		Calendar cal = Calendar.getInstance();
		cal.setTime(date);
		cal.add(Calendar.DATE, day);
		return cal.getTime();
	}
	public void setOutTime(Date outTime) {
		this.outTime = outTime;
	}
	public Date getCreateTime() {
		return createTime;
	}
	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	public int getStatus() {
		return status;
	}
	public void setStatus(int status) {
		this.status = status;
	}
    
}
